<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/jquery-1.10.1.js" ></script>
    <script>
        $(document).ready(function(){
           /** $("button").on('click', function(){
                $.ajax({
                    url: 'http://nk9zcw.natappfree.cc/hello.do',
                    data: 'uname=tom&psd=123456',
                    type: 'GET',
                    dataType: 'json',
                    success:function(data) {
                        console.info(data)
                        data.forEach(n => {
                            $("ul").append(`<li>${n}</li>`)
                        })
                    }
                })
            }) */
            // 四个参数， 1。url   2. data   3. success  4.dataType
            $.post('http://nk9zcw.natappfree.cc/hello.do', 'uname=tom&psd=123456', function(data){
                data.forEach(n => {
                    $("ul").append(`<li>${n}</li>`)
                })
            }, 'json')
           
            $("button").data("aaa", "bbb");
            console.info($("button").data("aaa"))
        })

    </script>
</head>
<body>
    <button>切换</button>
    <div id="a1">hello world</div>
   <ul>

   </ul>
   <input type=checkbox  checked=false />
</body>
</html>